function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = P30b.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(10, 16);
g1(1,3)=T(4)*T(17)-T(6)*T(18);
g1(1,4)=T(1)*T(22)-T(5)*T(23);
g1(1,7)=T(4)*T(31)-(params(2)*getPowerDeriv(y(7),params(7),1)+T(6)*T(32));
g1(1,12)=T(1)*T(36)-T(5)*T(6)*T(35);
g1(2,13)=T(9)*T(19)-T(12)*params(4)*T(19);
g1(2,4)=T(23);
g1(2,14)=T(10)*T(26)-(1-params(3)+params(4)*T(10))*T(27);
g1(2,5)=T(9)*T(30)-T(12)*params(4)*T(30);
g1(2,12)=T(6)*T(35);
g1(2,15)=T(10)*T(38)-(1-params(3)+params(4)*T(10))*params(1)*T(11)*T(37);
g1(3,3)=params(8);
g1(3,12)=1;
g1(4,3)=(-1);
g1(4,4)=1;
g1(4,6)=1;
g1(5,3)=1;
g1(5,1)=(-(T(14)*exp(y(9))*T(28)));
g1(5,7)=(-(T(13)*exp(y(9))*T(33)));
g1(5,9)=(-(T(13)*exp(y(9))*T(14)));
g1(6,1)=1-params(3);
g1(6,5)=(-1);
g1(6,6)=1;
g1(7,3)=(-(1/y(7)));
g1(7,7)=(-((-y(3))/(y(7)*y(7))));
g1(7,8)=1;
g1(8,2)=(-params(5));
g1(8,9)=1;
g1(8,16)=(-1);
g1(9,1)=(-(T(14)*T(29)));
g1(9,7)=(-(T(15)*T(33)));
g1(9,10)=1;
g1(10,1)=(-(T(16)*(1-params(4))*T(28)));
g1(10,7)=(-(T(13)*(1-params(4))*T(34)));
g1(10,11)=1;

end
